Performance of batches with Statements and PreparedStatements

Поиск
Список
Период
Сортировка
От Jeff Kolesky
Тема Performance of batches with Statements and PreparedStatements
Дата
Msg-id a05200f02bab8d618e684@[192.168.1.9]
обсуждение исходный текст
Ответы Re: Performance of batches with Statements and PreparedStatements  (Barry Lind <blind@xythos.com>)
Список pgsql-jdbc
I have some code that is inserting many rows into the database,
executing Statements repeatedly. I can run the inserts as batches
using the JDBC batch functionality, or I can concatenate the inserts
with semi-colons and execute one large statement.

If I take the semi-colon approach, I cannot use a PreparedStatement
easily, which is fine.  I read somewhere that the implementation of
executeBatch() just executes all of the statements one-by-one, which
would be as slow as executing separate statements.

I would like some advice as to which method would run faster and if
using PreparedStatements is a good performance boost.

Is there any limit to the number of statements that can be executed in a batch?

All advice is greatly appreciated.

Thanks.

Jeff


В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Dave Cramer
Дата:
Сообщение: Re: JDBC
Следующее
От: Peter Royal
Дата:
Сообщение: Index metadata not sorted by ORDINAL_POSITION